import request from '@/config/axios'

export interface CraftCourseVO {
  id: number
  carftName: string
  productNumber: string
  productName: string
  partName: string
  partNumber: string
  drawingNumber: string
  partSpecification: string
  version: string
  enableTime: Date
  stopTime: Date
  dictCourseStatus: number
  remark: string
  creatorName: string
}

// 查询配置中心--工艺配置--工艺路线列表
export const getCraftCoursePage = async (params) => {
  return await request.get({ url: `/config/craft-course/page`, params })
}

// 查询配置中心--工艺配置--工艺路线详情
export const getCraftCourse = async (id: number) => {
  return await request.get({ url: `/config/craft-course/get?id=` + id })
}

// 查询配置中心--工艺配置--工艺路线表单详情
export const getCraftCourseList = async (id: number) => {
  return await request.get({ url: `/config/craft-course-conf/list?id=` + id })
}

// 新增配置中心--工艺配置--工艺路线
export const createCraftCourse = async (data: CraftCourseVO) => {
  return await request.post({ url: `/config/craft-course/create`, data })
}

// 修改配置中心--工艺配置--工艺路线
export const updateCraftCourse = async (data: CraftCourseVO) => {
  return await request.put({ url: `/config/craft-course/update`, data })
}

// 删除配置中心--工艺配置--工艺路线
export const deleteCraftCourse = async (id: number) => {
  return await request.delete({ url: `/config/craft-course/delete?id=` + id })
}

// 导出配置中心--工艺配置--工艺路线 Excel
export const exportCraftCourse = async (params) => {
  return await request.download({ url: `/config/craft-course/export-excel`, params })
}

// 导出配置中心--工艺配置--指导书详情
export const getCraftCourseBook = async (params) => {
  return await request.get({ url: `/config/craft-task-bill-conf-file/page`, params })
}
